<?php

/**
 * PersonaDetalle form base class.
 *
 * @method PersonaDetalle getObject() Returns the current form's model object
 *
 * @package    sibi-salud
 * @subpackage form
 * @author     SIBI <sibiud@gmail.com>
 */
abstract class BasePersonaDetalleForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'persona_id'       => new sfWidgetFormPropelChoice(array('model' => 'Persona', 'add_empty' => true)),
      'localidad_id'     => new sfWidgetFormPropelChoice(array('model' => 'Localidad', 'add_empty' => true)),
      'lugar_nacimiento' => new sfWidgetFormInputText(),
      'celular'          => new sfWidgetFormInputText(),
      'estrato'          => new sfWidgetFormInputText(),
      'rh_id'            => new sfWidgetFormPropelChoice(array('model' => 'Rh', 'add_empty' => true)),
      'genero'           => new sfWidgetFormInputCheckbox(),
      'estado_civil_id'  => new sfWidgetFormPropelChoice(array('model' => 'EstadoCivil', 'add_empty' => true)),
      'created_at'       => new sfWidgetFormDateTime(),
      'updated_at'       => new sfWidgetFormDateTime(),
      'id'               => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'persona_id'       => new sfValidatorPropelChoice(array('model' => 'Persona', 'column' => 'id', 'required' => false)),
      'localidad_id'     => new sfValidatorPropelChoice(array('model' => 'Localidad', 'column' => 'id', 'required' => false)),
      'lugar_nacimiento' => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'celular'          => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'estrato'          => new sfValidatorInteger(array('min' => -128, 'max' => 127, 'required' => false)),
      'rh_id'            => new sfValidatorPropelChoice(array('model' => 'Rh', 'column' => 'id', 'required' => false)),
      'genero'           => new sfValidatorBoolean(),
      'estado_civil_id'  => new sfValidatorPropelChoice(array('model' => 'EstadoCivil', 'column' => 'id', 'required' => false)),
      'created_at'       => new sfValidatorDateTime(array('required' => false)),
      'updated_at'       => new sfValidatorDateTime(array('required' => false)),
      'id'               => new sfValidatorPropelChoice(array('model' => 'PersonaDetalle', 'column' => 'id', 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('persona_detalle[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'PersonaDetalle';
  }


}
